package com.cyq.stock.controller;

import com.cyq.stock.feign.ProductFeignService;
import com.cyq.stock.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private StockFeignService stockFeignService;

    @Autowired
    private ProductFeignService productFeignService;

    @GetMapping("/add")
    public String add() {
        System.out.println("下单成功!");
        String msg = stockFeignService.reduct();
        String productMsg = productFeignService.add("666");
        return "Hello OpenFeign!" + msg + "||||" + productMsg;
    }
}
